//
//  ManagementCenterViewController.m
//  Ai
//
//  Created by 杜超男 on 2019/3/6.
//  Copyright © 2019年 杜超男. All rights reserved.
//

#import "ManagementCenterViewController.h"
#import "XLSlideSwitch.h"//滑动滚动第三方
#import "ServeDredgeCollectViewController.h"//服务开通汇总
#import "ClassManageManViewController.h"//班级管理人员
#import "PushSurveyPreviewViewController.h"//推送情况全览
#import "Masonry.h"
@interface ManagementCenterViewController ()<XLSlideSwitchDelegate>
@property (nonatomic , strong)XLSlideSwitch *ScrollView;///滚动视图
@end

@implementation ManagementCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
    maskLayer.frame = self.view.bounds;
    maskLayer.path = maskPath.CGPath;
    self.view.layer.mask = maskLayer;
    /*
     #import "ServeDredgeCollectViewController.h"//服务开通汇总
     #import "ClassManageManViewController.h"//班级管理人员
     #import "PushSurveyPreviewViewController.h"//推送情况全览
     */
    //创建一个数组用来存储名字
    NSArray *TitlesArr = @[@"服务开通汇总" , @"班级管理人员" , @"推送情况全览"];
    NSArray *ControllersArr = @[@"ServeDredgeCollectViewController" , @"ClassManageManViewController" , @"PushSurveyPreviewViewController"];
    NSMutableArray *ViewControllers = [[NSMutableArray alloc] init];
    for (int i = 0 ; i < TitlesArr.count; i ++) {
        //字符串创建控制器
        UIViewController *VC = [[NSClassFromString(ControllersArr[i])alloc] init];
        [ViewControllers addObject:VC];
    }
    //滚动视图
    _ScrollView = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 16, self.view.bounds.size.width, self.view.bounds.size.height - 64) Titles:TitlesArr viewControllers:ViewControllers];
    _ScrollView.delegate = self;
    //rgba(102/255.0, 102, 102, 1)
    _ScrollView.itemNormalColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1];
    //rgba(72/255.0, 169/255.0, 54/255.0, 1)
    _ScrollView.itemSelectedColor = [UIColor colorWithRed:72/255.0 green:169/255.0 blue:54/255.0 alpha:1];
    _ScrollView.customTitleSpacing = 30;
    _ScrollView.hideShadow=YES;
    [_ScrollView showInViewController:self];
    [_ScrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).inset(16);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(0);
        
    }];
}
@end
